cmake_minimum_required(VERSION 2.8.3)
project(px4_gcs)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
    roscpp
    rospy
    mavros
    roslib
    std_msgs
    message_generation
    message_filters
    serial
)

add_message_files(
        FILES
        swarm_state.msg
)

generate_messages(
        DEPENDENCIES
        std_msgs
)


catkin_package(
)

include_directories(
     include
  ${catkin_INCLUDE_DIRS}
)


add_executable(serial_test src/serial_test.cpp)
add_dependencies(serial_test ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(serial_test ${catkin_LIBRARIES} )

add_executable(drone_unit src/drone_unit.cpp)
add_dependencies(drone_unit ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(drone_unit ${catkin_LIBRARIES} )

add_executable(mavros_pos_test src/mavros_pos_test.cpp)
add_dependencies(mavros_pos_test ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(mavros_pos_test ${catkin_LIBRARIES} )

add_executable(mavros_pos_send_test src/mavros_pos_send_test.cpp)
add_dependencies(mavros_pos_send_test ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(mavros_pos_send_test ${catkin_LIBRARIES} )

add_executable(offb_core src/offb_core.cpp)
add_dependencies(offb_core ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(offb_core ${catkin_LIBRARIES} )

add_executable(offb_core_c src/MultiDaodanSimu.cpp src/OffboardCore.h src/OffboardCore.cpp)
add_dependencies(offb_core_c ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(offb_core_c ${catkin_LIBRARIES} )

add_executable(hgj_coverage src/HGJMultiUAVCoverage.cpp src/OffboardCore.h src/OffboardCore.cpp)
add_dependencies(hgj_coverage ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(hgj_coverage ${catkin_LIBRARIES} )